package com.why.controller;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.why.entity.Choicequestion;
import com.why.service.ChoicequestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * (Choicequestion)表控制层
 *
 * @author makejava
 * @since 2023-05-27 18:01:56
 */
@RestController
@RequestMapping("/choicequestion")
@CrossOrigin
public class ChoicequestionController {
    /**
     * 服务对象
     */
    @Autowired
    private ChoicequestionService choicequestionService;

    @GetMapping("/list/{id}")
    private List<Choicequestion> list(@PathVariable("id") Long id) {
        LambdaQueryWrapper<Choicequestion> queryWrapper = new LambdaQueryWrapper<Choicequestion>();
        queryWrapper.eq(Choicequestion::getExaminationid, id);
        List<Choicequestion> choicequestionList = choicequestionService.list(queryWrapper);
        return choicequestionList;
    }

}

